package com.aier.user.common;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class UserPhoneUtil {

    /**
     * 电话使用次数
     */
    public static final int PHONE_FREQUENCT = 0;
    /**
     * 手机
     */
    public static final short USER_PHONE_MOBILE = 10;

    /**
     * 普通电话
     */
    public static final short USER_PHONE_FIXEDTELE = 0;

    /**
     * 电话公开
     */
    public static final short PHONE_OPENTYPE_OPEN = 0;
    /**
     * 电话不公开
     */
    public static final short PHONE_OPENTYPE_CLOSE = 10;
    /**
     * 电话好友公开
     */
    public static final short PHONE_OPENTYPE_FRIEND_OPEN = 20;
    /**
     * 状态：普通
     */
    public static final short PHONE_STATE_NORMAL = 0;
    /**
     * 状态：常用
     */
    public static final short PHONE_STATE_USERD = 10;

    /**
     * 判断是否是手机
     * @param mobiles
     * @return
     */
    public static boolean isMobileNO(String mobiles) {
        Pattern p = Pattern
                .compile("^[1]([3-8][0-9]{1}|59|58|88|89)[0-9]{8}$");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }
}
